<script type="text/javascript">
	<!--
	function getWindowHeight() {
		var windowHeight = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			}
			else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
				}
			}
		}
		return windowHeight;
	}

	function setContent()
	{
		if ( !document.getElementById ) return;
		var windowHeight = getWindowHeight();
		if ( windowHeight > 0 )
		{
			var contentElement = document.getElementById('cont');
			var contentHeight = contentElement.offsetHeight;

			if (windowHeight - contentHeight > 0)
			{
				contentElement.style.position = 'relative';
				contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
			}
			else
			{
				contentElement.style.position = 'static';
			}
		}
	}

	window.onload = setContent;
	window.onresize = setContent;
	//-->
</script>

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
	google.load("jquery", "1.5.1");
	google.load("visualization", "1", {packages:["corechart"]});
</script>

<script type="text/javascript">
	<!--
	$(document).ready(function() {
		var data = new google.visualization.DataTable();
		data.addColumn('string', 'Деятельность');
		data.addColumn('number', 'Время');
		data.addRows(<?=count($list)?>);

		<? $i = 0; foreach ( $list as $title => $data ) { ?>
			<? if ( !$val = (int)$data['index'] ) continue; ?>
			data.setValue(<?=$i?>, 0, '<?=  htmlspecialchars($title)?>');
			data.setValue(<?=$i?>, 1, <?=$val?>);
		<? $i++; } ?>
		var chart = new google.visualization.PieChart(document.getElementById('graph'));

		chart.draw(data, {
			width: 300,
			height: 300,
			legend: 'none',
			chartArea: {left:0,top:0,width:"100%",height:"100%"}
		});
	});
	//-->
</script>